package cn.clementine.core.vo;

public class Result{
    public long code;
    public Object data;
    public String msg;
    public long Timestamp;

    public Result(long code, Object data, String msg, long timestamp) {
        this.code = code;
        this.data = data;
        this.msg = msg;
        Timestamp = timestamp;
    }
    public static Result ok(Object obj){
        return new Result(200,obj,"success",System.currentTimeMillis());
    }
    public static Result ok(Object obj,String msg){
        return new Result(200,obj,msg,System.currentTimeMillis());
    }
    public static Result fail(Object obj,String error){
        return new Result(400,obj,error,System.currentTimeMillis());
    }
    public static Result fail(String error){
        return new Result(400,"",error,System.currentTimeMillis());
    }
}
